import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { SkYueJuTypeVO, SkYueJuTypeForm, SkYueJuTypeQuery } from '@/api/app/SkYueJuType/types';

/**
 * 查询约局类型列表
 * @param query
 * @returns {*}
 */

export const listSkYueJuType = (query?: SkYueJuTypeQuery): AxiosPromise<SkYueJuTypeVO[]> => {
  return request({
    url: '/app/SkYueJuType/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询约局类型详细
 * @param id
 */
export const getSkYueJuType = (id: string | number): AxiosPromise<SkYueJuTypeVO> => {
  return request({
    url: '/app/SkYueJuType/' + id,
    method: 'get'
  });
};

/**
 * 新增约局类型
 * @param data
 */
export const addSkYueJuType = (data: SkYueJuTypeForm) => {
  return request({
    url: '/app/SkYueJuType',
    method: 'post',
    data: data
  });
};

/**
 * 修改约局类型
 * @param data
 */
export const updateSkYueJuType = (data: SkYueJuTypeForm) => {
  return request({
    url: '/app/SkYueJuType',
    method: 'put',
    data: data
  });
};

/**
 * 删除约局类型
 * @param id
 */
export const delSkYueJuType = (id: string | number | Array<string | number>) => {
  return request({
    url: '/app/SkYueJuType/' + id,
    method: 'delete'
  });
};

export const allOneList = () => {
  return request({
    url: '/app/SkYueJuType/allOneList',
    method: 'get'
  });
};
